000100*AAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCC
000200*                      
000300*                    (SEQ)                        (SEQ)                  
000400 IDENTIFICATION              DIVISION.
000500 PROGRAM-ID.                 SEQTEST.
000600*AUTHOR.                     KENJI KIMURA.
000700 ENVIRONMENT                 DIVISION.
000800 CONFIGURATION               SECTION.
000900 INPUT-OUTPUT                SECTION.
001000 FILE-CONTROL.
001100*                        
001200*ACMFILE
001300*ACMASSIGNNAME=dbtests
001400*ACMRECNAME=I-RECORD
001500     SELECT INP-FILE ASSIGN TO "xxxxxx"
001600       ORGANIZATION LINE SEQUENTIAL.
001700 DATA                        DIVISION.
001800 FILE                        SECTION.
001900*                    
002000 FD  INP-FILE.
002100 COPY "I_RECORD.cbl".
002200 WORKING-STORAGE             SECTION.
002300 01  SOME-AREA.
002400     05  I-COUNTER           PIC 9(05).
002500     05  O-COUNTER           PIC 9(05).
002600     05  END-FLG             PIC 9(01)  VALUE  ZERO.
002700 01  OPTION-AREA.
002800     05  OPTIONVALUE         PIC X(10).
002900 PROCEDURE                   DIVISION.
003000*              
003100 MAIN                        SECTION.
003200     PERFORM   INIT.
003300     PERFORM   FL-OPEN.
003400     PERFORM  INP-READ.
003500*                                                      
003600     PERFORM   UNTIL  END-FLG  NOT  =  ZERO
003700*                 OR  I-COUNTER     > 10000
003800        PERFORM  OUT-WRITE
003900        PERFORM  INP-READ
004000     END-PERFORM.
004100     PERFORM   FL-CLOSE.
004200     PERFORM   TERM.
005300     STOP RUN.
005400*              
005500 INIT                        SECTION.
005600     DISPLAY   "PROGRAM STARTING.".
005700     EXIT.
005800*                      
005900 FL-OPEN                     SECTION.
006000     OPEN   INPUT  INP-FILE.
006100     EXIT.
006200*                  
006300 INP-READ                    SECTION.
006400     READ INP-FILE NEXT
006500       AT END  MOVE 1 TO END-FLG
006600     END-READ.
006700     IF  END-FLG  =  ZERO
006800*                                                                
006900         ADD  1              TO  I-COUNTER
007000     END-IF.
007100     EXIT.
007200*                  
007300 OUT-WRITE                   SECTION.
007400     DISPLAY  I-RECORD.
007500     ADD  1                  TO  O-COUNTER.
007600     EXIT.
007700*                              
007800 FL-CLOSE                    SECTION.
007900     CLOSE  INP-FILE.
008000     EXIT.
008100*              
008200 TERM                        SECTION.
008300     DISPLAY   "PROGRAM NORMALLY TERMINATED.".
008400     DISPLAY   "INPUT-COUNT:" I-COUNTER.
008500     DISPLAY   "OUTPUT-COUNT:" O-COUNTER.
008600     EXIT.
